package roborally.usableitems;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Raw;
import roborally.itemsonboard.Robot;
import roborally.supporting.Terminatable;

/**
 * This interface specifies usable items that can be possessed and used by a robot. All methods are implemented
 * nominal.
 * 
 * 
 * @author Molderez Tom, 2de bach Ingenieurswetenschappen Computerwetenschappen-Elektrotechniek and Reniers Jorn, 2de bach Ingenieurswetenschappen Werktuigkunde-Computerwetenschappen
 * @version 2.0
 */
public interface Usable extends ItemWithWeight, Terminatable{
	
	/**
	 * Returns whether this usable item is possessed by a robot or not.
	 */
	@Basic @Raw
	public abstract boolean isPossessed();
	
	/**
	 * Sets whether this item is possessed by a robot or not.
	 * 
	 * @param value The value to be set.
	 * @post
	 * 		| (new this).isPossessed() == value
	 */
	public abstract void setPossessed(boolean value);
	
	/**
	 * The usable will be used by the robot. The specified effect depends of the implementing class.
	 * 
	 * @param robot The robot to which the energy of this battery must go.
	 * @pre
	 * 		| robot != null
	 * @pre 
	 * 		| robot.canUse(this)
	 * @pre
	 * 		| !isTerminated()
	 */
	public abstract void isUsed(Robot robot);
	
}
